// @ts-ignore
import { request } from '@umijs/max';

// 新反馈 评分
export async function feedbacksStar(body: any) {
  return request<API.ReqResult>(`/api/documents/user_rate`, {
    method: 'POST',
    data: body,
  });
}
// 点赞和点踩 某个句子
export async function feedbacksComment(body: any) {
  return request<API.ReqResult>(`/api/feedbacks/comment`, {
    method: 'POST',
    data: body,
  });
}
// 获取具体文档版本 用于评分和点赞和点踩 数据回显
export async function feedbacksInfo(params: any) {
  return request<API.ReqResult>(`/api/documents/${params.uuid}`, {
    method: 'GET',
    params: {
      version_no: params.version_no,
    },
  });
}

// 聊天功能
export async function helpChat(body: any) {
  return request<API.ReqResult>(`/api/ai_helper/query`, {
    method: 'POST',
    data: body,
  });
}
// 仿写重写
export async function rewriteSentence(body: any) {
  return request<API.ReqResult>(`/api/rewrite`, {
    method: 'POST',
    data: body,
  });
}

// 相关推荐
export async function articleRecommend(body: any) {
  return request<API.ReqResult>(`/api/ai_helper/query`, {
    method: 'POST',
    data: body,
  });
}

// 获取所有反馈理由
export async function feedback_reasons(params: any) {
  return request<API.ReqResult>(`/api/free/feedback_reasons`, {
    method: 'GET',
    params,
  });
}
// 反馈理由提交
export async function search_feedback(body: any) {
  return request<API.ReqResult>(`/api/free/search_feedback`, {
    method: 'POST',
    data: body,
  });
}
